//
// Created by sagnitude on 12/30/2015.
//

#ifndef IDSREDIS_CPP_LOGIC_H
#define IDSREDIS_CPP_LOGIC_H

#include <string>
#include <algorithm>
#include <vector>

#include "hiredis/hiredis.h"

#include "cpp-hiredis-cluster/include/cluster.h"
#include "cpp-hiredis-cluster/include/hirediscommand.h"

#include "rapidjson/include/rapidjson/rapidjson.h"
#include "rapidjson/include/rapidjson/document.h"
#include "rapidjson/include/rapidjson/writer.h"
#include "rapidjson/include/rapidjson/stringbuffer.h"

typedef std::string String;

#define RedisCommand(...) static_cast<redisReply*>(RedisCluster::HiredisCommand<>::Command(cluster_p, __VA_ARGS__))

#define ULL (unsigned long long int)

#define Cluster RedisCluster::Cluster<redisContext>::ptr_t
#define CreateCluster RedisCluster::HiredisCommand<>::createCluster

Cluster cluster_p = CreateCluster("192.168.1.201", 7401);

class Logic {

public:
    static String ListAd(String endUserSn, String triggerType, String appToken, String jsonBeacons);
};


#endif //IDSREDIS_CPP_LOGIC_H
